﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BarcodeProductManagement.Models;

namespace BarcodeProductManagement.Controllers
{
    public class LogonController : Controller
    {
        [AcceptVerbs(HttpVerbs.Get)]
        public ActionResult Logon()
        {
            return View();
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public RedirectToRouteResult Logon(LogonModel logonModel)
        {
            //validate logon accounts here and navigate to corresponding page
            //Now operator will be linked to default page(logon success default)
            if (logonModel.UserName != "admin")
            {
                return RedirectToAction("WaitVerification", "Logon");
            }
            else
            {
                return RedirectToAction("Default", "InternalDefaultView");
            }
        }

        public ActionResult WaitVerification()
        {
            return View();
        }
    }
}
